package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author YYP
 * @date 2020/12/28
 */
public interface BrandMapper extends BaseMapper<Brand> {
    @Select("select tb.* from tb_brand tb\n" +
            "inner join tb_category_brand tbc\n" +
            "on tb.id = tbc.brand_id\n" +
            "WHERE tbc.category_id=#{categoryId}")
    List<Brand> listBrandByCategoryId(@Param("categoryId") Long categoryId);
}
